PROBLEM 1 WORKAROUND: run the following commands in the Administrator console (cmd.exe): If the above doesn't help, please try these commands instead: EXCEPTION: PROBLEM 2 WORKAROUND EXCEPTION: Or caused by
If all the 50 ports between 6942 and 6991 are reserved, taken by the other apps or firewall doesn't allow IDE to bind on them, startup fails with the below exception:netsh int ipv4 set dynamicport tcp start=49152 num=16383
netsh int ipv4 set dynamicport udp start=49152 num=16383
net stop winnat
net start winnat
java.util.concurrent.CompletionException: java.net.BindException:
at java.base/java.util.concurrent.CompletableFuture.encodeThrowable()
at java.base/java.util.concurrent.CompletableFuture.completeThrowable()
at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run()
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker()
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run()
at java.base/java.lang.Thread.run()
Caused by: java.net.BindException:
at java.base/sun.nio.ch.Net.bind0()
at java.base/sun.nio.ch.Net.bind()
at java.base/sun.nio.ch.Net.bind()
at java.base/sun.nio.ch.ServerSocketChannelImpl.bind()
at io.netty.channel.socket.nio.NioServerSocketChannel.doBind()
at io.netty.channel.AbstractChannel$AbstractUnsafe.bind()
at io.netty.channel.DefaultChannelPipeline$HeadContext.bind()
at io.netty.channel.AbstractChannelHandlerContext.invokeBind()
at io.netty.channel.AbstractChannelHandlerContext.bind()
at io.netty.channel.DefaultChannelPipeline.bind()
at io.netty.channel.AbstractChannel.bind()
at io.netty.bootstrap.AbstractBootstrap$2.run()
at io.netty.util.concurrent.AbstractEventExecutor.safeExecute()
at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks()
at io.netty.channel.nio.NioEventLoop.run()
at io.netty.util.concurrent.SingleThreadEventExecutor$4.run()
at io.netty.util.internal.ThreadExecutorMap$2.run()
at io.netty.util.concurrent.FastThreadLocalRunnable.run()
... 1 more
-----
JRE 11.0.6+8-b765.25 amd64 by JetBrains s.r.o
C:
Unable to start the IDE with a network limited due to firewall/VPN: See IDEA-253939 for example.
Add -Djava.net.preferIPv4Stack=true to the IDE's .vmoptions file and start the IDE.
Check here to find the .vmoptions file: https://intellij-support.jetbrains.com/hc/en-us/articles/206544869 .java.util.concurrent.CompletionException: java.lang.IllegalStateException:
at java.base/java.util.concurrent.CompletableFuture.encodeThrowable()
at java.base/java.util.concurrent.CompletableFuture.completeThrowable()
at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run()
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker()
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run()
at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run()
at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run()
at java.base/java.security.AccessController.doPrivileged()
at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run()
at java.base/java.lang.Thread.run()
Caused by: java.lang.IllegalStateException:
at io.netty.util.concurrent.MultithreadEventExecutorGroup.<init>()
at io.netty.util.concurrent.MultithreadEventExecutorGroup.<init>()
at io.netty.util.concurrent.MultithreadEventExecutorGroup.<init>()
at io.netty.channel.MultithreadEventLoopGroup.<init>()
at io.netty.channel.nio.NioEventLoopGroup.<init>()
at io.netty.channel.nio.NioEventLoopGroup.<init>()
at io.netty.channel.nio.NioEventLoopGroup.<init>()
at org.jetbrains.io.BuiltInServerKt.multiThreadEventLoopGroup()
at org.jetbrains.io.BuiltInServerKt.access$multiThreadEventLoopGroup()
at org.jetbrains.io.BuiltInServer$Companion.start()
at org.jetbrains.io.BuiltInServer.start()
at com.intellij.idea.SocketLock.lambda$lockAndTryActivate$2()
at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run()
... 7 more
Caused by: io.netty.channel.ChannelException:
at io.netty.channel.nio.NioEventLoop.openSelector()
at io.netty.channel.nio.NioEventLoop.<init>()
at io.netty.channel.nio.NioEventLoopGroup.newChild()
at io.netty.channel.nio.NioEventLoopGroup.newChild()
at io.netty.util.concurrent.MultithreadEventExecutorGroup.<init>()
... 19 more
Caused by: java.io.IOException:
at java.base/sun.nio.ch.PipeImpl$Initializer.run()
at java.base/sun.nio.ch.PipeImpl$Initializer.run()
at java.base/java.security.AccessController.doPrivileged()
at java.base/sun.nio.ch.PipeImpl.<init>()
at java.base/sun.nio.ch.SelectorProviderImpl.openPipe()
at java.base/java.nio.channels.Pipe.open()
at java.base/sun.nio.ch.WindowsSelectorImpl.<init>()
at java.base/sun.nio.ch.WindowsSelectorProvider.openSelector()
at io.netty.channel.nio.NioEventLoop.openSelector()
... 23 more
Caused by: java.net.ConnectException:
at java.base/sun.nio.ch.Net.connect0()
at java.base/sun.nio.ch.Net.connect()
at java.base/sun.nio.ch.Net.connect()
at java.base/sun.nio.ch.SocketChannelImpl.connect()
at java.base/java.nio.channels.SocketChannel.open()
at java.base/sun.nio.ch.PipeImpl$Initializer$LoopbackConnector.run()
at java.base/sun.nio.ch.PipeImpl$Initializer.run()
... 31 more
-----
JRE 11.0.8+10-b1129.2 amd64 by JetBrains s.r.o.
C:
Caused by: java.net.SocketException: Permission denied: connect in last part.
@Sofia.Byzova To lock folders IDE is starting a server on localhost, it tries to bind on the first available port between 6942 and 6991, this exception is thrown if IDE was not able to bind on any of the ports in this range. All 50 ports are unlikely to be already used on a machine, so it appears to be a networking issue or some security software which doesn't permit IDE to bind on any port in this range even on localhost interface.
You can check with TcpView if these ports are already taken: https://docs.microsoft.com/en-us/sysinternals/downloads/tcpview . It will show the process using the ports.
But in case of the firewall it can just block the bind operation and TcpView will not show anything.
netsh winsock reset followed by the reboot usually helps.
We have a lot of similar reports, some of them are related to Hyper-V reserving the huge range of ports: https://intellij-support.jetbrains.com/hc/en-us/articles/360007568559?page=1#comment_360001282960 .
C:\Users\alxx>netsh interface ipv4 show excludedportrange protocol=tcp
Protocol tcp Port Exclusion Ranges
Start Port End Port
---------- --------
1030 1129
1130 1229
1264 1363
1364 1463
1548 1647
1684 1783
1802 1901
1902 2001
2002 2101
2180 2279
2280 2379
2380 2479
2488 2587
2588 2687
2688 2787
2788 2887
2888 2987
2988 3087
3088 3187
3188 3287
3288 3387
3388 3487
3488 3587
3997 4096
4097 4196
4197 4296
4297 4396
4397 4496
4497 4596
4606 4705
4706 4805
4806 4905
4906 5005
5357 5357
5658 5757
5758 5857
5858 5957
5958 6057
6058 6157
6158 6257
6258 6357
28385 28385
50000 50059 *
* - Administered port exclusions.
Suggested solutions:
netsh interface ipv4 show excludedportrange protocol=tcp. We can do it only if default range fails to not waste time on checking in other cases.Related posts:
After installing this update, applications may not be able to reserve or bind to ports that previously worked.
To resolve this issue, use the following workaround.
Check if the port you want to bind to or reserve is already reserved on the container host. For example, you can use netsh as follows:
netsh interface ipv4 show excludedportrange protocol=tcp
If the port is not reserved, you may use it. If it is reserved, choose a different port.
Would it be problematic to just bind to a different address in the 127.0.0.0/8 loopback range?
Line 87 of BuiltInServer.kt calls InetAddress.getLoopbackAddress() which always returns IPv4 127.0.0.1 or the IPv6 ::1.
Could it not just be set to always use some other address consistently like 127.88.88.88 where it's unlikely any other program would be bound to those 50 ports on that exact address?
So I've just got it again. TcpView shows that those ports are free.
I've opened the firewall and see the following picture:
I haven't set anything up specially but I see some connections of IDEA are blocked. Why?.. Even after manually unlocking them, the issue still persists...
Protocol tcp Port Exclusion Ranges
Start Port End Port
---------- --------
1876 1975
1976 2075
2076 2175
2869 2869
3288 3387
3390 3489
3490 3589
4449 4548
4549 4648
4649 4748
4749 4848
4849 4948
5357 5357
6687 6786
6787 6886
6887 6986
6987 7086
7087 7186
8486 8585
8586 8685
8686 8785
12868 12967
12968 13067
13168 13267
13268 13367
13368 13467
13568 13667
50000 50059 *
* - Administered port exclusions.
Blocked by the OS? Oh...
Hi JetBrains developers. Do you use those TCP connections through the loopback/localhost (127.0.0.1) for the inter process communication (IPC) between the locally running IntelliJ modules? There are several bug reports like this and all of them seem to be triggered by conflicts with firewalls or VPNs widely used these days. Did you consider some other IPC implementation that doesn't depend and doesn't conflict with any firewall or VPN? For example:
The UNIX domain socket is natively supported even in Windows, from Windows 10 Version 1803.
https://bsmadhu.wordpress.com/2018/08/22/unix-domain-socket-support-in-windows/
https://unwcf.com/posts/unix-sockets/
There is an ongoing and partially done development of supporting UNIX domain socket in Java. It's called JEP-380
https://openjdk.java.net/jeps/380
https://bugs.openjdk.java.net/browse/JDK-8238588
Java can read named pipe but can't create it without using JNI or JNA:
https://cdimascio.wordpress.com/2014/01/11/named-pipes-with-java/
For shared memory file you can write your own library based on the java.nio.MappedByteBuffer class or use a library like Mappedbus:
https://github.com/caplogic/mappedbus
Hi,
I'm looking to change over to Rider from VS but I can't get it to open at all.
Crashes on startup with the exception above.
I've tried all the workarounds suggested but nothing works.
It's a fresh install of Rider 2020.2.
Not running Hyper-V.
Attached the output of "netsh interface ipv4 show excludedportrange protocol=tcp"
I've been looking to change to Rider for about a year now but every time I install a new version I get this error.
Any help would be appreciated.
Thanks,
Quentin.
you have the required range reserved by the system: 6905 - 7004 according to the provided screenshot. Not sure which app/service is adding this range to the excluded ports, but this command when you run it from Administrator is supposed to reset the excluded ports: netsh int ipv4 set dynamicport tcp start=49152 num=16383.
Since the IDE will bind to port 6942 to 6991, this solution that reserves ports before Hyper-V works for me: https://stackoverflow.com/a/54727281/3689736
Added another workaround with these commands:
net stop winnat
net start winnat
please contact support at https://intellij-support.jetbrains.com/hc/requests/new with the logs folder attached (https://intellij-support.jetbrains.com/hc/en-us/articles/207241085). See if reinstalling PyCharm from https://www.jetbrains.com/pycharm/download/index.html helps. Your problem doesn't seem to be related to this specific ticket.
Workaround sometimes works for me, sometimes doesn't; granted I do use a likely troublesome combo:
In the end, binding to a port for file / resource locking is not recommended, the solution is to use platform-specific mechanisms.
I just hit this as well and the lack of alert dialog in 2021.2.1 seems like a regression. I had to go back to 2021.1.3 to realise what was wrong.
The
net stop winnat
net start winnat
solution fixed this for me.
I had never had this problem until today, even thought I have Hyper-V active. I wonder if this issue has got worse since this weeks updates from Microsoft, which I applied yesterday. I have a X-Server program, X410, which fails to start with similar symptoms and it was also fixed by stop/starting winnat.
That this is not fixed after almost two years is bad, that the IDE gives zero indication that there's a critical problem is far worse. Do you understand how to do basic exception handling, JetBrains?
I guess it doesn't matter since there is zero chance of me buying Rider after such a poor first-use experience. After using Visual Studio exclusively since .NET Framework 1.0, I was thinking it would be impossible for any would-be competitor to be worse - but you've not only proved me wrong, you've failed at the very first step - so congratulations on being terrible!
Understandably you're frustrated for not being able to use Rider. However, basing your conclusions entirely on this initial bad experience, I'm afraid you've misjudged Jetbrains. Their products are really great. Not perfect, no, but when working for some time with their IDEs you will see that they really care about developer experience, and they have improved my daily life like no other software. I wish more companies would take example from Jetbrains.
The above issue has also affected me, hence I'm following it. However, I applied the workaround which worked, and was able to continue my work.
Rider may actually be a good alternative to VS for you, once you get it running, so it would be a lost opportunity for yourself to burn it so quickly.
Do reconsider, and if you have any issues applying the workaround please write again, but without the snarks. I'm sure someone will be able to help.
If you're looking to analyze the log file then these commands may help:
PS > Clear-Content $env:LOCALAPPDATA\\JetBrains\\PyCharm*\\log\\idea.log
PS > Get-Content -Tail 100 -Wait -Path $env:LOCALAPPDATA\\JetBrains\\PyCharm*\\log\\idea.log
from duplicate IDEA-286661 .
Maybe just like the one-click virusscanner directory exclusion, JetBrains could add a button that does `netsh int ipv4 add excludedportrange protocol=tcp startport=<portnr> numberofports=1` on the ports it requires. If it's a range it needs, you can increase the `numberofports=`.
To comply with Internet Assigned Numbers Authority (IANA) recommendations, Microsoft has increased the dynamic client port range for outgoing connections in Windows Vista and Windows Server 2008. The new default start port is 49152, and the new default end port is 65535. This is a change from the configuration of earlier versions of Windows that used a default port range of 1025 through 5000.
The suggested command resets the dynamic client ports range to the IANA recommendations.
Hello to everyone in this "chat", lemme join the waiting list.
So... it's been 2.5 years since this bug was open? I guess we'll need to wait another 7 or so years until it resolved if ever (as per experience with infamous rsync bug). The fact that they have a link to blog post with startup errors embedded in a stack trace in error window suggest that there is no hope for seeing it solved in a near future (if ever, since link is already there).
Oh, right. jetbrains, I have an amazing idea for you. Check stack trace for specific errors (as per blog post) and just display workaround in the same window with bold font. Then you will be able to resolve this and other startup issues. Easy-peasy.